package micro.web.controller;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import io.swagger.annotations.Api;
import micro.data.model.User;
import micro.web.client.UserFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author txw
 * @version V1.0
 * @Title: EmailController
 * @ProjectName micro-email-server
 * @Description: 描述
 * @since 2018/6/20 23:25
 */
@RestController
@RequestMapping("/micro/email/")
@Api("邮箱服务")
public class EmailController {

    private final UserFeignClient userFeignClient;
    @Autowired
    public EmailController(UserFeignClient userFeignClient) {
        this.userFeignClient = userFeignClient;
    }


    @GetMapping("getUserById/{id}")
    public User getUserById(@PathVariable("id") Long id){
        return userFeignClient.findById(id);
    }
}
